package com.zzt.textlib;


import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class MyClass {
    public static void main(String[] args) {
        boolean s = okEditInput("sdds ddd d dfds");
        System.out.println(">>>>>> " + s);
    }

    /**
     * 判断是否规定格式
     */
    public static boolean okEditInput(String repStr) {
        String regex = "([\\w]{4}\\s)*[\\w]{0,4}";
//        String regex = "[\\w]{0,4}";
        Pattern pattern = Pattern.compile(regex);
        Matcher match = pattern.matcher(repStr);
        return match.matches();
    }

}